/*
* Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description: Storedialog.qml.
*/

import QtQuick 1.0

/*!
 *  \file
 *  \brief Defines dialog to shows notifications.
 *
 *  Dialog is used to show notifications when device is connected and
 *  when a shared location is received from the other device.
 */

Rectangle {
    id: myShowDialog
    height: 150
    width: 300
    anchors.centerIn: parent
    color:  "gray"
    opacity: 0.8
    border.width: 1
    radius: 5

    Text {
        x: 5
        y: 5
        id: labelName
        text: "Location name:"
        font.bold: true;
        font.pixelSize: 25
    }

    Rectangle {
        x: 5
        y: labelName.height + 5
        width: parent.width - 10
        height: 50
        color: "white"
        TextInput {
            width: parent.width -10
            height: 50
            anchors.verticalCenter: parent.verticalCenter
            id: locationText
            font.pixelSize: 25
            focus: true
        }
    }

    Rectangle {
        width: parent.width
        height: 60
        y: parent.height - 60
        color:  "gray"
        opacity: 0.8

        Button {
            x: 5
            label: "Store"
            visible: myShowDialog.visible
            onButtonClicked: {
                locationManager.storeCurrentLocation(locationText.text);
                myShowDialog.visible = false;
            }
        }

        Button {
            x: parent.width / 2 + 5
            label: "Close"
            visible: myShowDialog.visible
            onButtonClicked: {
                myShowDialog.visible = false;
            }
        }
    }
}
